/**
 * File    : UniversalDao.java
 * Created : 2007-12-20
 * By      : lhg
 */
package com.luhuiguo.sso.tutorial.dao;

import java.io.Serializable;
import java.util.List;

/**
 * @author lhg
 * @version $Id: UniversalDao.java 2 2008-10-04 13:04:21Z LuHuiguo $
 * 
 */
public interface UniversalDao {

	public <T> T findById(Class<T> entityClass, Serializable id);

	public void create(Object entity);

	public <T> T update(T entity);

	public void delete(Object entity);

	public void delete(Class<?> entityClass, Serializable id);

	public <T> List<T> findByProperty(Class<T> entityClass,
			String propertyName, final Object value,
			final int... rowStartIdxAndCount);

	public <T> List<T> findAll(Class<T> entityClass,
			final int... rowStartIdxAndCount);

	public Object findFirstByNamedQuery(final String queryName,
			final Object... values);
}
